#!/bin/bash
(
cat << EOF
default menu.c32
prompt 1
timeout 15
menu title Install Linux by PXE

label autolinux
	menu label Auto ^Install $2 Linux
	kernel ../images/$2/$3/vmlinuz
	append initrd=../images/$2/$3/initrd.img ip=dhcp repo=http://$1/os/$2/$3 ks=http://$1/kickstarts/$2_$3_ks.cfg ksdevice=$4
label manuallinux
      menu label Manual ^Install $2 Linux
      kernel ../images/$2/$3/vmlinuz
      append initrd=../images/$2/$3/initrd.img ip=dhcp inst.repo=http://$1/os/$2/$3
label local
  menu label Boot from ^local drive
  localboot 0xffff
EOF
) > /var/lib/tftpboot/pxelinux/pxelinux.cfg/default
echo -e "/var/lib/tftpboot/pxelinux/pxelinux.cfg/default is create \033[32mSuccessful\033[0m"

